<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理后台</title>
<link href="Css/css.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
<!--
function fnOnPageChanged(page) {
	g('search').action += '&page='+page;
	document.search.submit();
}
function g(id) {
	return document.getElementById(id);
}
function fnOnCreated() {
	var url = '<?php echo $this->_url('Create',array('type'=>$type)); ?>';
	document.location.href = url;
}

// -->
</script>
<style type="text/css">
<!--
body {
	background-color: #ddeef2;
}
-->
</style>
</head>
<body>
<div id="main_title"><a href="#">后台管理中心</a>—<?php echo $listTitle; ?>
</div>
<div id="main_list">
<form name="search" id="search" method="post" action="">
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
  <tr>
    <td align="center" width="10%">部门：</td>
    <td align="center" width="15%">
    <select name="department" size="1" id="department">
	  <option value="0">--请选择--</option>
		<?php
        if (isset($_REQUEST['department'])) {
        	$selectedClasses = $_REQUEST['department'];
        }
        foreach ($deptclasses as $class){
        ?>
        <option value="<?php echo $class['class_id']; ?>"<?php if ($class['class_id']==$selectedClasses): ?>selected<?php endif; ?>><?=$class['name']?></option>
        <?php 
		}
        ?>
    </select>
    </td>
    <td align="center" width="10%">年：</td>
    <td align="center" width="10%">
      <select name="year" id="year">
      	<option value="">All</option>
        <?php
        for($i=date("Y")-1;$i<=date("Y")+1;$i++){
		?>
    	<option value="<?=$i?>" <?php if($i==$_REQUEST['year']) echo 'selected'; ?>><?=$i?></option>
        <?php
		}
		?>
      </select>
    </td>
    <td align="center" width="10%">月：</td>
    <td align="center" width="15%">
      <select name="month" id="month">
      	<option value="">All</option>
      <?php
      for($i=1;$i<=12;$i++){
	  ?>
    	<option value="<?=$i?>" <?php if($i==$_REQUEST['month']) echo 'selected'; ?>><?=$i?></option>
      <?php
      }
	  ?>
      </select>
    </td>
    <td align="center"><input type="submit" name="csvInput" id="csvInput" value="查询" /></td>
  </tr>
</table>
</form>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
    <tr>
    <td width="15%" align="center" bgcolor="#9EC1DE" class="title">月份</td>
    <td width="15%" align="center" bgcolor="#9EC1DE" class="title">部门</td>
    <td width="15%" align="center" bgcolor="#9EC1DE" class="title">工资总额</td>
    <td width="20%" align="center" bgcolor="#9EC1DE" class="title">记录增加时间</td>
    <td width="20%" align="center" bgcolor="#9EC1DE" class="title">记录更新时间</td>
    <td align="center" bgcolor="#9EC1DE" class="title">操作</td>
  </tr>
  <?php $i = 0; foreach($rowset as $row): $css_class = $i % 2 ? 'even' : 'odd'; $rowid = array('id' => $row[$pk],'type' => $type,'access'=>$_REQUEST['access']); ?>
  <tr>
    <td align="center" bgcolor="#F4FAFB" class="content"><?=$row['year'].'-'.$row['month']?></td>
    <td align="center" bgcolor="#F4FAFB" class="content"><?=$row['department']?></td>
    <td align="center" bgcolor="#F4FAFB" class="content"><?=$row['total']?></td>
    <td align="center" bgcolor="#F4FAFB" class="content"><?=date('Y-m-d H:i:s',$row['dateline'])?></td>
    <td align="center" bgcolor="#F4FAFB" class="content"><?=date('Y-m-d H:i:s',$row['updated'])?></td>
    <td align="center" bgcolor="#F4FAFB" class="content"><a href="<?php echo $this->_url('attendanceDetail', array('dept_id'=>$row['dept_id'],'year'=>$row['year'],'month'=>$row['month'],'department'=>$row['department'])); ?>">查看详情</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="<?php echo $this->_url('Export', array('dept_id'=>$row['dept_id'],'year'=>$row['year'],'month'=>$row['month'],'department'=>$row['department'])); ?>">财务</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="<?php echo $this->_url('Export2', array('dept_id'=>$row['dept_id'],'year'=>$row['year'],'month'=>$row['month'],'department'=>$row['department'])); ?>">签字</a></td>
  </tr>
  <?php $i++; endforeach; ?>
</table>
</div>
<div id="main_copy">Copyright&copy;2003 – 2009 ITeam Monkey. All Rights Reserved ITeam Monkey 版权所有 </div>
</body>
</html>
